package com.bitdf.txing.users.ao;

import com.bitdf.txing.users.valid.LoginOrRegist;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

/**
 * @author Lizhiwei
 * @date 2023/3/4 21:59:23
 * 注释：
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class LoginRegistUserAo {
    /**
     * 用户名
     */
    @Length(max = 15,min = 2,message = "用户名需要大于2位小于15位字符",groups = {LoginOrRegist.class})
    private String userName;
    /**
     * 密码
     */
    @NotNull(message = "密码不得为空",groups = {LoginOrRegist.class})
    @Length(max = 15,min = 6,message ="密码必须大于等于6位小于等于15位",groups = {LoginOrRegist.class})
    private String password;
    /**
     * 手机号
     */
    @Pattern(regexp = "^[1]([3-9])[0-9]{9}$",message = "手机号格式不正确",groups = {LoginOrRegist.class})
    private String phone;
}
